﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Xml;

namespace Person_Project
{
    [XmlRoot]
    public class Person
    {
        public Person() : this(0, "Имя", "Фамилия", 0)
        {
        }

        public Person(int ID) : this(ID, "Имя", "Фамилия", 0)
        {                       
        }

        public Person(int ID, string FNAME) : this(ID, FNAME, "Фамилия", 0)
        { 
        }

        public Person(int ID, string FNAME, string LNAME) : this(ID, FNAME, LNAME, 0)
        { 
        }

        public Person(int ID, string FNAME, string LNAME, int AGE)
        {
            this.id = ID;
            this.fName = FNAME;
            this.lName = LNAME;
            this.Age = AGE;
            this.Contacts = new List<Contact>();
            this.Adresses = new List<Adress>();
        }

        [XmlElement]   
        public int id { get; set; }
        [XmlElement]
        public string fName { get; set; }
        [XmlElement]
        public string lName { get; set; }
        [XmlElement]
        public int Age { get; set; }
        [XmlElement(typeof(List<Adress>))]
        public List<Adress> Adresses { get; set; }
        [XmlElement(typeof(List<Contact>))]
        public List<Contact> Contacts = null;
      
    }
}
